<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>⽐较两个对象或者两个数完全相等</title>
</head>
<body>
    <script>
        // 比较两个对象完全相等
        var obj1 = {
            x: 110,
            y: 120
        };
        var obj2 = {
            x: 130,
            y: 140
        };
        if(obj1 === obj2){// 判断全等于
            console.log('obj1等于obj2')
        }else{
            console.log('obj1不等于obj2')
        }

        // 比较两个数值完全相等
        var name1 = prompt('请输入数值（数值名为name1）');
        var name2 = prompt('请输入数值（数值名为name1）');
        name1 = Number(name1);
        name2 = Number(name2);
        if(name1 === name2){// 判断全等于
            console.log('name1等于name2')
        }else{
            console.log('name1等于name2')
        }
    </script>
</body>
</html>